package inline.core;

import java.net.URL;
import java.net.URLConnection;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

import android.util.Log;


public class InlineWebServiceClient  {
	private static final String LOG_TAG = "InlineWebServiceClient";
	
    
    public static void main(){
    	try{
    		URL url = new URL("http://www.dxxd.net/test.xml");
    		URLConnection urlconn = url.openConnection();
    		
    		Document doc = null;
    		
    		try{
    			DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    			DocumentBuilder db = dbf.newDocumentBuilder();
    			doc = db.parse(urlconn.getInputStream());
    			
    			Element fromEl = (Element)doc.getElementsByTagName("body").item(0);
    			String val = "" + ((Node) fromEl.getChildNodes().item(0)).getNodeValue();
    			Log.i(LOG_TAG, val);
    		} catch (Exception e){
    			Log.e(LOG_TAG,"Exception 1:" + e.toString());
    		}
    	}catch (Exception e){
    		Log.e(LOG_TAG,"Exception 2" + e.toString());
    	}
    }
}